Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

Q is empty.


QTRS
  ↳ AAECC Innermost

Q restricted rewrite system:
The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

Q is empty.

We have applied [19,8] to switch to innermost. The TRS R 1 is

double(0) → 0
double(s(x)) → s(s(double(x)))
le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)

The TRS R 2 is

triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The signature Sigma is {if, true, triple}

↳ QTRS
  ↳ AAECC Innermost
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)


Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
LE(0, y, z) → GREATER(y, z)
GREATER(s(x), s(y)) → GREATER(x, y)
TRIPLE(x) → DOUBLE(x)
TRIPLE(x) → LE(x, x, double(x))
LE(s(x), s(y), s(z)) → LE(x, y, z)
DOUBLE(s(x)) → DOUBLE(x)
IF(first, x, y, z) → LE(s(x), y, s(z))
IF(second, x, y, z) → LE(s(x), s(y), z)
IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)
TRIPLE(x) → IF(le(x, x, double(x)), x, 0, 0)

The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
LE(0, y, z) → GREATER(y, z)
GREATER(s(x), s(y)) → GREATER(x, y)
TRIPLE(x) → DOUBLE(x)
TRIPLE(x) → LE(x, x, double(x))
LE(s(x), s(y), s(z)) → LE(x, y, z)
DOUBLE(s(x)) → DOUBLE(x)
IF(first, x, y, z) → LE(s(x), y, s(z))
IF(second, x, y, z) → LE(s(x), s(y), z)
IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)
TRIPLE(x) → IF(le(x, x, double(x)), x, 0, 0)

The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 4 SCCs with 6 less nodes.

↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
QDP
                ↳ UsableRulesProof
              ↳ QDP
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DOUBLE(s(x)) → DOUBLE(x)

The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ QReductionProof
              ↳ QDP
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DOUBLE(s(x)) → DOUBLE(x)

R is empty.
The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QReductionProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ QDP
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

DOUBLE(s(x)) → DOUBLE(x)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
QDP
                ↳ UsableRulesProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

GREATER(s(x), s(y)) → GREATER(x, y)

The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ QReductionProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

GREATER(s(x), s(y)) → GREATER(x, y)

R is empty.
The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QReductionProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

GREATER(s(x), s(y)) → GREATER(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
QDP
                ↳ UsableRulesProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LE(s(x), s(y), s(z)) → LE(x, y, z)

The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ QReductionProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LE(s(x), s(y), s(z)) → LE(x, y, z)

R is empty.
The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QReductionProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LE(s(x), s(y), s(z)) → LE(x, y, z)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
QDP
                ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)

The TRS R consists of the following rules:

le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
triple(x) → if(le(x, x, double(x)), x, 0, 0)
if(false, x, y, z) → true
if(first, x, y, z) → if(le(s(x), y, s(z)), s(x), y, s(z))
if(second, x, y, z) → if(le(s(x), s(y), z), s(x), s(y), z)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)

The TRS R consists of the following rules:

le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))
double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

double(0)
double(s(x0))
triple(x0)
if(false, x0, x1, x2)
if(first, x0, x1, x2)
if(second, x0, x1, x2)



↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QReductionProof
QDP
                        ↳ NonInfProof

Q DP problem:
The TRS P consists of the following rules:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)

The TRS R consists of the following rules:

le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.
The DP Problem is simplified using the Induction Calculus [18] with the following steps:
Note that final constraints are written in bold face.


For Pair IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z)) the following chains were created:




For Pair IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z) the following chains were created:




To summarize, we get the following constraints P for the following pairs.



The constraints for P> respective Pbound are constructed from P where we just replace every occurence of "t ≥ s" in P by "t > s" respective "t ≥ c". Here c stands for the fresh constant used for Pbound.
Using the following integer polynomial ordering the resulting constraints can be solved
Polynomial interpretation [18]:

POL(0) = 0   
POL(IF(x1, x2, x3, x4)) = -1 - x1 - x2 + x4   
POL(c) = -1   
POL(false) = 1   
POL(first) = 0   
POL(greater(x1, x2)) = 0   
POL(le(x1, x2, x3)) = 0   
POL(s(x1)) = 1 + x1   
POL(second) = 0   

The following pairs are in P>:

IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)
The following pairs are in Pbound:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
IF(second, x, y, z) → IF(le(s(x), s(y), z), s(x), s(y), z)
The following rules are usable:

greater(y, z) → le(0, y, z)
falsele(s(x), 0, z)
falsele(s(x), s(y), 0)
le(x, y, z) → le(s(x), s(y), s(z))
greater(x, y) → greater(s(x), s(y))
firstgreater(x, 0)
secondgreater(0, s(y))


↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QReductionProof
                      ↳ QDP
                        ↳ NonInfProof
QDP
                            ↳ NonInfProof

Q DP problem:
The TRS P consists of the following rules:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))

The TRS R consists of the following rules:

le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.
The DP Problem is simplified using the Induction Calculus [18] with the following steps:
Note that final constraints are written in bold face.


For Pair IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z)) the following chains were created:




To summarize, we get the following constraints P for the following pairs.



The constraints for P> respective Pbound are constructed from P where we just replace every occurence of "t ≥ s" in P by "t > s" respective "t ≥ c". Here c stands for the fresh constant used for Pbound.
Using the following integer polynomial ordering the resulting constraints can be solved
Polynomial interpretation [18]:

POL(0) = 0   
POL(IF(x1, x2, x3, x4)) = -1 - x1 - x2 + x3   
POL(c) = -1   
POL(false) = 0   
POL(first) = 0   
POL(greater(x1, x2)) = 0   
POL(le(x1, x2, x3)) = 0   
POL(s(x1)) = 1 + x1   
POL(second) = 0   

The following pairs are in P>:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
The following pairs are in Pbound:

IF(first, x, y, z) → IF(le(s(x), y, s(z)), s(x), y, s(z))
The following rules are usable:

greater(y, z) → le(0, y, z)
falsele(s(x), 0, z)
falsele(s(x), s(y), 0)
le(x, y, z) → le(s(x), s(y), s(z))
greater(x, y) → greater(s(x), s(y))
firstgreater(x, 0)
secondgreater(0, s(y))


↳ QTRS
  ↳ AAECC Innermost
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QReductionProof
                      ↳ QDP
                        ↳ NonInfProof
                          ↳ QDP
                            ↳ NonInfProof
QDP
                                ↳ PisEmptyProof

Q DP problem:
P is empty.
The TRS R consists of the following rules:

le(s(x), s(y), 0) → false
le(s(x), s(y), s(z)) → le(x, y, z)
le(0, y, z) → greater(y, z)
le(s(x), 0, z) → false
greater(x, 0) → first
greater(0, s(y)) → second
greater(s(x), s(y)) → greater(x, y)

The set Q consists of the following terms:

le(0, x0, x1)
le(s(x0), 0, x1)
le(s(x0), s(x1), 0)
le(s(x0), s(x1), s(x2))
greater(x0, 0)
greater(0, s(x0))
greater(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.